<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        margin: 0 auto;
        width: 400px;
      }

      .header {
        border-bottom: 1px solid gray;
        overflow: auto;
      }

      .header>span{
          color: gray;
          float: right;
      }


      h1 {
          text-align: center;
      }
      
      p {
        color: black;
        text-align: center;
      }

      p:hover {
        color: salmon;
        font-size: 1.1em;
      }

      .main {
          background-color:lightcyan;
      }
    </style>
  </head>
  <body>
    <div class="container">
        <div class="header">
            <h1>将进酒</h1>
            <span>【作者】李白</span>
            <span>【朝代】唐</span>
        </div>
        
      <div class="main">
          <p>君不见，黄河之水天上来，奔流到海不复回。</p>
          <p>君不见，高堂明镜悲白发，朝如青丝暮成雪。</p>
          <p>人生得意须尽欢，莫使金樽空对月。</p>
          <p>天生我材必有用，千金散尽还复来。</p>
          <p>烹羊宰牛且为乐，会须一饮三百杯。</p>
          <p>岑夫子，丹丘生，将进酒，杯莫停。</p>
          <p>与君歌一曲，请君为我倾耳听。</p>
          <p>钟鼓馔玉不足贵，但愿长醉不复醒。</p>
          <p>古来圣贤皆寂寞，惟有饮者留其名。</p>
          <p>陈王昔时宴平乐，斗酒十千恣欢谑。</p>
          <p>主人何为言少钱，径须沽取对君酌。</p>
          <p>五花马，千金裘，呼儿将出换美酒，与尔同销万古愁。</p>
      </div>
    </div>

    <script>

        var pList = document.getElementsByTagName("p");
        console.log(pList);
        for (var i = 0; i < pList.length; i++) {
          var element = pList[i];
          element.onclick = function() {
            alert(this.innerHTML);
          }
        }


    </script>


  </body>
</html>
